/*
 * Powered By zhangyunhua
 * Web Site: http://www.hhk.com 
 * Since 2008 - 2012
 */


package com.khh.garment.basedata.crcy.impl;

import java.util.List;

import org.springframework.beans.factory.InitializingBean;

import com.khh.base.assertion.AssertArgument;
import com.khh.garment.basedata.crcy.CrcyFactory;
import com.khh.garment.basedata.crcy.dao.CrcyDao;
import com.khh.garment.basedata.crcy.entity.Crcy;

public class CrcyFactoryImpl   implements CrcyFactory,InitializingBean {

	private CrcyDao crcyDao;

	public CrcyDao getCrcyDao() {
		return crcyDao;
	}

	public void setCrcyDao(CrcyDao crcyDao) {
		this.crcyDao = crcyDao;;
	}
	
	
	public Crcy createCrcy(){
		Crcy p = new Crcy();
		//p.setCreatedate(new Date());			
		return p;
	}
	
	
	/**
	 * 新增或修改
	 * @param crcy
	 */
	public void saveCrcy(Crcy crcy){
		this.crcyDao.saveCrcy(crcy);
	}
	

	/**
	 * 删除
	 * @param crcy
	 */
	public void deleteCrcy(Crcy crcy){
		this.crcyDao.deleteCrcy(crcy);
	}
	
	/**
	 * 查找
	 * @param 
	 * @return
	 */
	public Crcy findBySN(String crcySN){		
		return this.crcyDao.findBySN(crcySN);
	}
	
	/**
	 * 根据原sn查找
	 * @param suppliersn
	 * @return
	 */
	public List<Crcy> findByNo(String crcyno){
		return this.crcyDao.findByNo(crcyno);
	}
	
	
	public void afterPropertiesSet() throws Exception {
		// TODO Auto-generated method stub
		AssertArgument.isNotNull(crcyDao, "crcyDao");
	}

	@Override
	public void validCrcy(Crcy penalty) {
		// TODO Auto-generated method stub
		
	}

}



